Native (Wiki) Plugin
The native plugin uses the Wiki specification or interface to speak with plugins.
To use the native plugin, Moab Workload Manager must be properly configured
as described in the Moab Configuration section.
For configuration, all URLs can be defined as:
Example | File | Action |
---|
file:///nodes.txt | /nodes.txt | Reads the file as a flat text file |
exec:///tmp/nodes.pl | /tmp/nodes.pl | Executes the file as a script and uses the output. Must return a non-zero value for failure. |
http://domain.com/nodes | - | Executes a web call using the defined URL |
Required Configuration
Parameter | Type | Description |
---|
None | | |
While no URL is specifically required, if no URLs are defined, the plugin will not do anything.
Optional Configuration
Do not use getNodes
and getVirtualMachines
in combination with getCluster
. If getCluster
is used, the
getNodes
and getVirtualMachines
URLs will never be called.
Parameter | Type | Description |
---|
environment | Query String | The environment to be set when running scripts (only if exec URLs are used). |
getJobs | String | The URL to call when retrieving job information. |
getNodes | String | The URL to call when retrieving node information. |
getVirtualMachines | String | The URL to call when retrieving virtual machine information. |
getCluster | String | The URL to call when retrieving node and virtual machine information. |
jobCancel | String | The URL to call when canceling a job. |
jobModify | String | The URL to call when modifying a job. |
jobRequeue | String | The URL to call when requeuing a job. |
jobResume | String | The URL to call when resuming a job. |
jobStart | String | The URL to call when starting a job. |
jobSubmit | String | The URL to call when submitting a job. |
jobSuspend | String | The URL to call when suspending a job. |
nodeModify | String | The URL to call when modifying a node. |
nodePower | String | The URL to call when changing the power state of a node. |
resourceCreate | String | The URL to call when creating a resource. |
startUrl | String | The URL to call when starting the associated Plugin. |
stopUrl | String | The URL to call when stopping the associated Plugin. |
systemModify | String | The URL to call when modifying system properties. |
systemQuery | String | The URL to call when querying system properties. |
virtualMachineMigrate | String | The URL to call when migrating a virtual machine. |
Exposed Web Services
Method | Parameters | Parameter Type | Description |
---|
None | | | |
Native plugin Interface Comparison
Most of the Native Plugin's functionality is copied from the Native plugin interface in Moab. The following is a table comparing the two interfaces,
the plugin URL vs the plugin equivalent configuration entry, and can be used to port Native plugin scripts to the Native Plugin.
Plugin URL | Plugin Config | Notes |
---|
ALLOCURL | - | Deprecated |
CREDCTLURL | - | Deprecated |
CLUSTERQUERYURL | getCluster or getNodes/getVirtualMachines | See above note in the configuration descriptions. |
INFOQUERYURL | - | Deprecated |
JOBCANCELURL | jobCancel | |
JOBMIGRATEURL | virtualMachineMigrate | |
JOBMODIFYURL | jobModify | |
JOBREQUEUEURL | jobRequeue | |
JOBRESUMEURL | jobResume | |
JOBSIGNALURL | - | Deprecated |
JOBSTARTURL | jobStart | |
JOBSUBMITURL | jobSubmit | |
JOBSUSPENDURL | jobSuspend | |
JOBVALIDATEURL | - | Deprecated |
NODEMIGRATEURL | - | Deprecated |
NODEMODIFYURL | nodeModify | |
NODEPOWERURL | nodePower | |
NODEVIRTUALIZEURL | - | Deprecated |
PARCREATEURL | - | Deprecated |
PARDESTROYURL | - | Deprecated |
QUEUEQUERYURL | - | Deprecated |
RESOURCECREATEURL | resourceCreate | |
RMINITIALIZEURL | - | Deprecated |
RMSTARTURL | startUrl | This URL is no longer called by Moab, but by the plugin during the beforeStart phase. |
RMSTOPURL | stopUrl | This URL is no longer called by Moab, but by the Plugin during the afterStop phase. |
RSVCTLURL | - | Deprecated |
SYSTEMMODIFYURL | systemModify | |
SYSTEMQUERYURL | systemQuery | |
WORKLOADQUERYURL | getJobs | |
Calling URLs
This section contains a guide to the command line parameters expected and the return data from
all URLs that can be configured.
All URLs are expected to return a line with a status code and an optional message,
such as:
SC=0 RESPONSE=Custom message here
Additionally, if the URL type is a script (
exec
scheme), the exit code must be zero for success and non-zero for
a failure case.
The environment can be set for any scripts run by using the
environment
configuration parameter as described above. Ex:
config {
environment = "HOMEDIR=/root/&LIBDIR=/var/lib&EXTRAOPTION"
}
The above configuration would set
HOMEDIR
,
LIBDIR
, and
EXTRAOPTION
environment parameters on all scripts executed
through the plugin.
getJobs
Arguments
None
Response
Native Wiki for jobs, one per line.
SC=0 RESPONSE=Success
Moab.1 STATE=Idle;UNAME=username;GNAME=groupname
Moab.2 STATE=Completed;UNAME=username;GNAME=groupname
getNodes
Arguments
None
Response
Native Wiki for nodes, one per line.
SC=0 RESPONSE=Success
node01 STATE=Busy;CPROC=4;APROC=0
node02 STATE=Idle;CPROC=4;APROC=4
getVirtualMachines
Arguments
None
Response
Native Wiki for virtual machines, one per line.
Virtual machines without container nodes (e.g. their node
property is null) will be ignored and Wiki will not
be generated for them. This is to prevent issues with Moab recognizing virtual machines as nodes.
SC=0 RESPONSE=Success
vm1 STATE=Busy;CPROC=4;APROC=0;CONTAINERNODE=hv1
vm2 STATE=Idle;CPROC=4;APROC=4;CONTAINERNODE=hv1
getCluster
Arguments
None
Response
Native Wiki for nodes and virtual machines, one per line. The key difference between them is that VMs have
CONTAINERNODE
reported, while nodes do not.
SC=0 RESPONSE=Success
hv1 STATE=Busy;CPROC=4;APROC=0;VMOSLIST=linux
hv2 STATE=Idle;CPROC=4;APROC=4;OS=hyper;VMOSLIST=windows
vm1 STATE=Busy;CPROC=2;APROC=0;CONTAINERNODE=hv1;OS=linux
vm2 STATE=Idle;CPROC=2;APROC=2;CONTAINERNODE=hv1;OS=linux
jobCancel
Arguments
# <jobId> [<type>]
Moab.1
Moab.1 admin ??
Response
SC=0 RESPONSE=Canceled job 'Moab.1'
jobModify
Arguments
# -j <jobId> (--set|--clear|--increment|--decrement) <attribute>="<value>"
-j Moab.1 --set Account="newAccount"
-j Moab.1 --clear Account ??
-j Moab.1 --increment Hold="user" ??
-j Moab.1 --decrement Hold="user" ??
Response
SC=0 RESPONSE=Modified job 'Moab.1' successfully
jobRequeue
Arguments
# <jobId> [<type>]
Moab.1
Moab.1 admin ??
Response
SC=0 RESPONSE=Requeued job 'Moab.1' successfully
jobResume
Arguments
# <jobId> [<type>] ??
Moab.1
Moab.1 admin ??
Response
SC=0 RESPONSE=Resumed job 'Moab.1' successfully
jobStart
Arguments
# <jobId> <taskList> <userName> ??
Moab.1 vm1 myuser
Moab.1 node01,node01,node02,node02 myuser
Response
SC=0 RESPONSE=Started job 'Moab.1' on 'vm1' successfully
jobSubmit
Arguments
# <attribute>=<value> [<attribute>=<value>] …
# UNAME=<userName> GNAME=<groupName> WCLIMIT=<wallClock> TASKS=<tasksNumber> NAME=<jobId> IWD=<initialWorkingDirectory> EXEC=<executable>
UNAME=myuser GNAME=mygroup WCLIMIT=600 TASKS=2 NAME=Moab.1 IWD=/tmp EXEC=/tmp/script.sh
Response
SC=0 RESPONSE=Submitted job 'Moab.1' successfully
jobSuspend
Arguments
# <jobId> [<reason>] ??
Moab.1
Moab.1 "Not ready" ??
Response
SC=0 RESPONSE=Suspended job 'Moab.1' successfully
nodeModify
Arguments
# <nodeId>[,<nodeId>,...] --set <attribute>=<value> [<attribute>=<value>] …
node01,node02 --set Message="Powering off" Power=OFF
# <hypervisorId>:<vmId> --set <attribute>=<value> [<attribute>=<value>] …
hv1:vm1 --set Message="Powering off" Power=OFF
# node:destroy <hypervisorId>:<vmId> [operationid=<operationId>]
node:destroy hv1:vm1 operationid=vmdestroy-1
Response
SC=0 RESPONSE=Modified node(s) 'node01,node02' successfully
nodePower
Arguments
# <nodeId>[,<nodeId>,...] <powerState>
vm1 OFF
hv1,hv2,hv3 OFF
powerState
is one of the node
power states (namely ON, OFF, or BOOT).
Response
SC=0 RESPONSE=Changed power state for 'vm1' to 'OFF' successfully
resourceCreate
Arguments
# vm <hypervisorId>:<vmId> OS=<os> CPROC=<configuredProcessors> [operationid=<operationId>]
vm hv1:vm1 OS=linux CPROC=4
vm hv1:vm1 OS=linux CPROC=4 operationid=vmcreate-1
Response
SC=0 RESPONSE=Created VM 'vm1' successfully
startUrl
Arguments
None.
Response
Exit code of 0 signifies success, other for failure.
stopUrl
Arguments
None.
Response
Exit code of 0 signifies success, other for failure.
systemModify
Arguments
This URL is undefined as yet, even though the below should work.
# createstorage STORAGESERVER=<storageNodeId> HOSTLIST=<host1>[,<host2>,...] JOBID=<jobId> USER=<userName> GROUP=<groupName> VARIABLE=<operationId> <gres>=<count>
createstorage STORAGESERVER=storage01 HOSTLIST=node01,node02 JOBID=Moab.1 USER=myuser group=mygroup VARIABLE=storagecreate-1 MATLAB=1 ??
# destroystorage STORAGESERVER=<storageNodeId> STORAGEID=<mountPoint> JOBID=<jobId>
destroystorage STORAGESERVER=storage01 STORAGEID=/nfs/mount JOBID=storagedestory-1 ??
Response
SC=0 RESPONSE=Created storage on 'storage01' successfully
systemQuery
Arguments
Response
virtualMachineMigrate
Arguments
# --vmigrate <vmId>.pn=<hvId> [operationid=<operationId>]
--vmigrate vm1.pn=hv1 operationid=vmmigrate-1 ??
Response
SC=0 RESPONSE=Successfully migrated VM 'vm1' to 'hv1'